package nc.ui.med.bd.sheshitype;

import java.awt.Component;

import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer;

import nc.ui.trade.pub.VOTreeNode;
import nc.vo.med.sheshitype.SheshiTypeVO;

public class TreeCellRender extends DefaultTreeCellRenderer{

	public TreeCellRender() {
		super();
		
	}
	 public Component getTreeCellRendererComponent(JTree tree, Object value,
	            boolean sel, boolean expanded, boolean leaf, int row,
	            boolean hasFocus) {
	        Component obj = super.getTreeCellRendererComponent(tree, value, sel, expanded,
	                leaf, row, hasFocus);        
	        if (value instanceof VOTreeNode) {
	        	SheshiTypeVO val = (SheshiTypeVO) ((VOTreeNode) value).getData();
	            if( val!=null ){
	                setText( val.getSheshitypecode()+" " + val.getSheshitypename() );
	            }
	        }	        
	        return obj;        
	    }
}
